<template>
  <div>
    <el-form-item
      v-if="
        $check_register_field('add', 'merchant_name', '/merchant_users/view')
      "
      label="商家名称"
      prop="merchant_name"
    >
      <el-input
        id="merchant_name"
        v-model="form['merchant_name']"
        placeholder="请输入商家名称"
      ></el-input>
    </el-form-item>
    <el-form-item
      v-if="
        $check_register_field(
          'add',
          'merchant_phone_number',
          '/merchant_users/view'
        )
      "
      label="商家电话"
      prop="merchant_phone_number"
    >
      <el-input
        id="merchant_phone_number"
        v-model="form['merchant_phone_number']"
        placeholder="请输入商家电话"
      ></el-input>
    </el-form-item>
  </div>
</template>

<script>
import mixin from '@/mixins/component.js'

export default {
  mixins: [mixin],
  props: {
    form: {
      type: Object,
      default: function () {
        return {
          merchant_name: '',
          merchant_phone_number: '',
        }
      },
    },
  },
  data() {
    return {
      field: 'merchant_users_id',
      url_add: '~/api/merchant_users/add?',
      url_set: '~/api/merchant_users/set?',
      url_upload: '~/api/merchant_users/upload?',

      rules: {
        merchant_name: [{ required: true, message: '商家名称不能为空' }],
        merchant_phone_number: [
          { required: true, message: '商家电话不能为空' },
        ],
      },
    }
  },
  methods: {},
  created() {},
}
</script>
